//
//  PictureScrollView.m
//  MilitaryDemo
//
//  Created by qianfeng01 on 15-7-5.
//  Copyright (c) 2015年 qianfeng01. All rights reserved.
//

#import "PictureScrollView.h"

@implementation PictureScrollView

-(void)setImageNames:(NSMutableArray *)imageNames{
    for (int i=0; i<imageNames.count; i++) {
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*kScreenSize.width, kScreenSize.height/6, kScreenSize.width, kScreenSize.height/3)];
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageNames[i]]placeholderImage:[UIImage imageNamed:@"zhanwei"]];
        [self addSubview:self.imageView];
    }
    self.pagingEnabled = YES;
    self.contentSize = CGSizeMake(kScreenSize.width*imageNames.count,kScreenSize.height/3 );
    
}

-(void)setTextArr:(NSMutableArray *)textArr
{
    for (int i=0; i<textArr.count; i++) {
        UILabel *Label=[[UILabel alloc]initWithFrame:CGRectMake(i*kScreenSize.width+20, kScreenSize.height/2, kScreenSize.width-40,50)];

           NSString *text=[NSString stringWithFormat:@"%d/%ld  %@",i+1,textArr.count,self.title];
        Label.text=text;
        Label.numberOfLines=0;
        Label.backgroundColor=[UIColor blackColor];
        Label.textColor=[UIColor whiteColor];
        [self addSubview:Label];
        UITextView *textView=[[UITextView alloc]initWithFrame:CGRectMake(i*kScreenSize.width+20, kScreenSize.height/2+50, kScreenSize.width-40, 2*(kScreenSize.height/5)-100)];
        textView.textAlignment=NSTextAlignmentLeft;
        textView.text=textArr[i];
        textView.textColor=[UIColor whiteColor];
        textView.editable=NO;
        textView.backgroundColor=[UIColor blackColor];
        [self addSubview:textView];
    }
    
}

@end
